﻿using MainService.ZNQD;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml.Serialization;

namespace MyTest
{
    public partial class Form5 : Form
    {
        public Form5()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            openFileDialog1.FileName = "solution";
            if(openFileDialog1.ShowDialog()==DialogResult.OK)
            {
                SolutionInfo sif = null;
                using (Stream sm = new FileStream(openFileDialog1.FileName, FileMode.Open)) 
                {
                    XmlSerializer xs = new XmlSerializer(typeof(SolutionInfo));
                    sif = (SolutionInfo)xs.Deserialize(sm);
                }
                using(Stream sm=new MemoryStream())
                {
                    XmlSerializer xs = new XmlSerializer(typeof(SolutionInfo));
                    xs.Serialize(sm,sif);
                    sm.Position = 0;
                    StreamReader sr = new StreamReader(sm);
                    string xml = sr.ReadToEnd();
                }

            }
        }
    }
}
